var limsOutsourcers = Gikam.getPageObject({

    getEditListColumns: function () {
        return [{
            checkbox: true
        },{
            index: true
        }, {
            field: 'outsourcerCode',
            title: 'T_LIMS_OUTSOURCERS.OUTSOURCERCODE',
            validators: ['strLength[0,24]', 'notEmpty', 'remote[/secure/basemodule/business/outsourcerss/action/validate-unique]'],
            type: 'link',
            width: 140
        }, {
            field: 'outsourcerName',
            title: 'T_LIMS_OUTSOURCERS.OUTSOURCERNAME',
            validators: ['strLength[0,120]', 'notEmpty']
        }, {
            field: 'contactName',
            title: 'T_LIMS_OUTSOURCERS.CONTACTNAME',
            // validators: ['strLength[0,36]', 'notEmpty'],
            width: 140
        }, {
            field: 'contactPhone',
            title: 'T_LIMS_OUTSOURCERS.CONTACTPHONE',
            // validators: ['strLength[0,24]', 'phone', 'notEmpty'],
            width: 140
        }, {
            field: 'contactAddress',
            title: 'T_LIMS_OUTSOURCERS.CONTACTADDRESS',
            // validators: ['strLength[0,140]', 'notEmpty'],
            width: 140
        }, {
            field: 'remark',
            title: 'T_LIMS_OUTSOURCERS.REMARK',
            width: 240
        }, /*{
            field: 'activedFlag',
            title: 'T_LIMS_OUTSOURCERS.ACTIVEDFLAG',
            type: 'select',
            category: 'sys',
            firstBlank: false,
            param: {
                codeCategoryId: 'yesorno'
            }
        }*/]
    },

    getBaseInfoFormFields: function () {
        return [{
            field: 'outsourcerCode',
            title: 'T_LIMS_OUTSOURCERS.OUTSOURCERCODE',
            validators: ['strLength[0,24]', 'notEmpty', 'remote[/secure/basemodule/business/outsourcerss/action/validate-unique]'],
            preInsert: true,
            // readonly: true
        }, {
            field: 'outsourcerName',
            title: 'T_LIMS_OUTSOURCERS.OUTSOURCERNAME',
            validators: ['strLength[0,120]', 'notEmpty'],
            preInsert: true,
        }, {
            field: 'contactName',
            title: 'T_LIMS_OUTSOURCERS.CONTACTNAME',
            validators: ['strLength[0,36]'],
            preInsert: true,
        }, {
            field: 'contactPhone',
            title: 'T_LIMS_OUTSOURCERS.CONTACTPHONE',
            validators: ['strLength[0,24]', 'phone'],
            preInsert: true,
        }, {
            field: 'contactAddress',
            title: 'T_LIMS_OUTSOURCERS.CONTACTADDRESS',
            validators: ['strLength[0,140]'],
            preInsert: true,
        }, {
            field: 'remark',
            title: 'T_LIMS_OUTSOURCERS.REMARK',
            validators: ['strLength[0,140]'],
            preInsert: true,
        },]
    },

    getSearchListColumns: function () {
        return [{
            checkbox: true
        },{
            index: true
        }, Gikam.status.getBpmnColumn(limsOutsourcers.workflow.dbTable), {
            field: 'outsourcerCode',
            title: 'T_LIMS_OUTSOURCERS.OUTSOURCERCODE'
        }, {
            field: 'outsourcerName',
            title: 'T_LIMS_OUTSOURCERS.OUTSOURCERNAME'
        }, {
            field: 'contactName',
            title: 'T_LIMS_OUTSOURCERS.CONTACTNAME'
        }, {
            field: 'contactPhone',
            title: 'T_LIMS_OUTSOURCERS.CONTACTPHONE'
        }, {
            field: 'contactAddress',
            title: 'T_LIMS_OUTSOURCERS.CONTACTADDRESS'
        }, {
            field: 'remark',
            title: 'T_LIMS_OUTSOURCERS.REMARK'
        }, {
            field: 'activedFlag',
            title: 'T_LIMS_OUTSOURCERS.ACTIVEDFLAG',
            type: 'select',
            category: 'sys',
            firstBlank: false,
            param: {
                codeCategoryId: 'yesorno'
            }
        }]
    },

    getChooseListColumns: function () {
        return [{index: true},{
            field: 'outsourcerCode',
            title: 'T_LIMS_OUTSOURCERS.OUTSOURCERCODE',
            width: 140
        }, {
            field: 'outsourcerName',
            title: 'T_LIMS_OUTSOURCERS.OUTSOURCERNAME',
            width: 140
        }, {
            field: 'contactName',
            title: 'T_LIMS_OUTSOURCERS.CONTACTNAME',
            width: 140
        }, {
            field: 'contactPhone',
            title: 'T_LIMS_OUTSOURCERS.CONTACTPHONE',
            width: 140
        }, {
            field: 'contactAddress',
            title: 'T_LIMS_OUTSOURCERS.CONTACTADDRESS',
            width: 140
        }, {
            field: 'remark',
            title: 'T_LIMS_OUTSOURCERS.REMARK',
            width: 140
        },]
    },

    baseUrl: IFM_CONTEXT + '/secure/basemodule/business/outsourcerss',

    /**
     * 以下为外包商检测项目表相关内容
     */
    getProductMainEditListColumns: function () {
        return [{
            checkbox: true
        },{
            index: true
        }, {
            field: 'productCode',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.PRODUCTCODE',
            width: 140
        }, {
            field: 'productName',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.PRODUCTNAME',
            width: 140
        }, {
            field: 'productType',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.PRODUCTTYPE',
            width: 140
        }, {
            field: 'standardCycle',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.STANDARDCYCLE',
            width: 140
        }, /*{
            field: 'activedFlag',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.ACTIVEDFLAG'
        }*/]
    },

    getProductMainBaseInfoFormFields: function () {
        return [{
            field: 'productCode',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.PRODUCTCODE',
            validators: ['strLength[0,10]', 'notEmpty'],
            type: 'choose',
            category: 'product-choose',
            onBeforeChoose: function () {
                return {
                    status_EQ: '1',
                    single: true
                }
            },
            onAfterChoose: function (rows, index) {
                if (Gikam.isNotEmpty(rows)) {
                    this.setData({
                        productId: rows[0].id,
                        productCode: rows[0].productCode,
                        productName: rows[0].productName,
                        productType: rows[0].productType,
                        standardCycle: rows[0].standardCycle,
                    })
                }
            },
            onClean: function (field, value, rowIndex) {
                this.setData({
                    productId: "",
                    productNames: "",
                })
            },
            preInsert: true,
        }, {
            field: 'productName',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.PRODUCTNAME',
            editable: false,
            validators: ['strLength[0,40]', 'notEmpty'],
            readonly: true
        }, {
            field: 'productType',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.PRODUCTTYPE',
            editable: false,
            validators: ['strLength[0,10]', 'notEmpty'],
            readonly: true,
            firstBlank: false,
            type: 'select',
            search: true,
            category: 'sys',
            param: {
                codeCategoryId: 'productCategory'
            },
        }, {
            field: 'standardCycle',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.STANDARDCYCLE',
            editable: false,
            validators: ['strLength[0,8]', 'notEmpty'],
            readonly: true
        }, /*{
            field: 'activedFlag',
            title: 'T_LIMS_OUTSOURCERS_PRODUCT_MAIN.ACTIVEDFLAG',
            validators: ['strLength[0,1]']
        },*/]
    },

    baseProductMainUrl: IFM_CONTEXT + '/secure/basemodule/business/outsourcers-product-mains',
})
